import {createRouter,createWebHashHistory} from 'vue-router'

const routes = [
    {
        path:'/',
        component: () => import('../views/Main.vue'),
        redirect:'home',
        children:[
            {
                path:'home',
                name:'Home',
                component: () => import('../views/Home.vue'),
            }
        ]
    },
    {
        path:'/user/access',
        name:'UserAccess',
        component: () => import('../views/UserAccess.vue'),
    },
    {
        path:'/post/bar',
        name:'PostBar',
        component: () => import('../views/PostBar.vue'),
    },
    {
        path:'/post/:id',
        name:'Post',
        component: () => import('../views/Post.vue'),
    },
    {
        path:'/content/manage',
        name: 'ContentManage',
        component: () => import('../views/ContentManage.vue'),
    },
    {
        path:'/content/:postId',
        name: 'Content',
        component: () => import('../views/Content.vue'),
    },
    {
        path:'/backend',
        component: () => import('../views/backend/Main.vue'),
        redirect:'/home',
        children:[
            {
                path:'home',
                name:'BackHome',
                component: () => import('../views/backend/Home.vue')
            }
        ]
    },
]

const router = createRouter({
    history:createWebHashHistory(),
    routes
})



export default router
